import components from './components'
import iView from 'iview'
import 'iview/dist/styles/iview.css'
import './App.vue'

const install = function(Vue) {
  if (install.installed) return

  components.map(component => {
    Vue.component(component.name, component)
  })
  Vue.use(iView)
}

if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}
var obj = {}
Object.assign(obj, iView, { install, ...components })

export default obj
